﻿using System;
using System.Collections.Generic;
using System.Web;
using System.IO;

/// <summary>
///Log 的摘要说明
/// </summary>
public class Log
{
    public static void Write(string content)
    {
        string logPath = HttpRuntime.AppDomainAppPath + @"\App_Data\log.txt";
        FileInfo info = new FileInfo(logPath);
        if (info.Exists && info.Length > 50 * 1024 * 1024)                 //如果大于50M，就删除
            File.Delete(logPath);
        StreamWriter writer = new StreamWriter(logPath, true);
        writer.WriteLine(content);
        writer.Flush();
        writer.Close();
    }
}